
set(JANSSON_ROOT "../")

include_directories(${JANSSON_ROOT}/include)


link_directories(${JANSSON_ROOT}/lib)

set(SOURCES2 
ethercat_motor_control.c
TCP.c 
# TCP_SERVER.c
)
# add_executable(TCP ${SOURCES2})
# target_link_libraries(TCP soem  jansson_d)
# install(TARGETS TCP DESTINATION bin)


add_executable(TCP_SERVER ethercat_motor_control.c TCP_SERVER.c)
target_link_libraries(TCP_SERVER soem  jansson_d)
install(TARGETS TCP_SERVER DESTINATION bin)

# set(SOURCES SDO_TCPCOM.c)
# add_executable(SDO_TCPCOM ${SOURCES})
# target_link_libraries(SDO_TCPCOM soem  jansson_d)
# install(TARGETS SDO_TCPCOM DESTINATION bin)




set(SOURCE_CONFIG_FILE "${CMAKE_SOURCE_DIR}/test/win32/SDO_TCPCOM/config.json")
set(TARGET_CONFIG_DIR "${CMAKE_BINARY_DIR}/test/win32/SDO_TCPCOM/")


file(COPY "${SOURCE_CONFIG_FILE}" DESTINATION "${TARGET_CONFIG_DIR}")



install(FILES ${CMAKE_SOURCE_DIR}/config.json DESTINATION bin)